﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void yangHuiTriangle(int n)
{
	//第一行直接填好，播下种子
	int data[30][30] = { 1 };

	int i, j;

	//从第二行开始填
	for (i = 1; i < n; i++)
	{
		data[i][0] = 1;
		for (j = 1; j <= i; j++)
		{
			data[i][j] = data[i - 1][j] + data[i - 1][j - 1]; //递推方程
		}
	}
	//填完打印
	for (i = 0; i < n; i++)
	{
		for (j = 0; j <= i; j++)
		{
			printf("%d ", data[i][j]);
		}
		putchar('\n');
	}
}

int main()
{
	int n = 0;
	scanf("%d", n);
	yangHuiTriangle(n);
	return 0;
}